package cn.tedu.service;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Component
@Aspect
public class AspectTest2 {
    @Pointcut("execution(* cn.tedu.service..*.*(..))")
    public void point2(){ }
    @Around("point2()")
    public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
        long start = System.currentTimeMillis();
        Object o = joinPoint.proceed();
        long end = System.currentTimeMillis();
        System.out.println("aop计算的耗时是："+(end-start));

        return o;
    }
}
